<style>
    body {
        background-color: #ffffff;
    }

    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>

<div class="layui-form layuimini-form">

    <input type="hidden" value="{$model->id}" name="id">

    <div class="layui-form-item">
        <label class="layui-form-label required">上级分类</label>
        <div class="layui-input-block">
            <select name="pid" lay-verify="required">
                <option value="0">顶级分类</option>
                {foreach $parent_arr as $k=>$vo}
                    {if $vo['id']!=$model->id}
                        <option {if $vo['id']==$model->pid} selected {/if} value="{$vo['id']}">{$vo['title']}</option>
                    {/if}
                {/foreach}
            </select>
            <tip>请选择上级分类</tip>
        </div>
    </div>


    {include file="layout/other/input"  label="分类名称"  name="title"  verify=""  value="$model.title" /}

    {include file="layout/other/uploader_img"  label="封面图"  name="images"  verify="" num="1"  value="$model.images" /}

    {include file="layout/other/number"  label="权重"  name="weight"  is_required="" verify="number"  value="$model.weight" /}

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="status">
                <option value="0" {if $model->status==0} selected="" {/if}>无效</option>
                <option value="1" {if $model->status==1} selected="" {/if}>有效</option>
            </select>
        </div>
    </div>






    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>

</div>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        form.on('submit(saveBtn)', function (data) {
            var post_data = data.field;
            console.log(post_data);
            postData("{:url('good_category/edit')}", post_data, '修改成功');
            return false;
        });
    });
</script>